using Canlipe;
using NUnit.Framework;
using Canlipe.Utils;
using System;
using System.Text;

namespace CanlipeTests
{
	[TestFixture]
	public class ConfigTest
	{
		[TestCase]
		public void FromStringTest ()
		{
			StringBuilder sb = new StringBuilder ();
			sb.AppendLine ("SiteTitle: siteTitle");
			sb.AppendLine ("SourceFolder: srcfolder/src");
			sb.AppendLine ("OutputFolder: outfolder/out");
			sb.AppendLine ("BaseUrl: http://baseUrl.com/supersite");

			Config cfg = Config.FromString (sb.ToString (), new ConsoleLogger ());
			
			Assert.AreEqual ("siteTitle", cfg.SiteTitle);
			Assert.AreEqual ("srcfolder/src", cfg.SourceFolder);
			Assert.AreEqual ("outfolder/out", cfg.OutputFolder);
			Assert.AreEqual ("http://baseUrl.com/supersite", cfg.BaseUrl);
		}
	}
}

